Remove undefined-behavior UnsafeTests.DangerousAs to stabilize jitstress leg#129793
Open
Copilot wants to merge 2 commits into
Open
Remove undefined-behavior UnsafeTests.DangerousAs to stabilize jitstress leg#129793Copilot wants to merge 2 commits into
UnsafeTests.DangerousAs to stabilize jitstress leg#129793Copilot wants to merge 2 commits into
Conversation
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix test failure in UnsafeTests.DangerousAs
Remove undefined-behavior Jun 24, 2026
UnsafeTests.DangerousAs to stabilize jitstress leg
jkotas
approved these changes
Jun 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes a unit test that exercises Unsafe.As<string>(object) on an incompatible runtime type, which can produce runtime/JIT-dependent behavior and intermittently fail under stress configurations (e.g., ARM jitstress). The remaining As() test still validates the supported/meaningful usage (object containing a string cast to string).
Changes:
- Deleted
UnsafeTests.DangerousAs(invalid cast scenario) fromUnsafeTests.cs. - Left the existing
As()test intact.
EgorBo
approved these changes
Jun 24, 2026
This was referenced Jun 24, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change addresses an intermittent failure in
System.Runtime.CompilerServices.UnsafeTests.DangerousAson jitstress ARM runs. The test asserted behavior from an invalid cast path (Unsafe.As<string>(object)) where the result is undefined.Fixes #129678